package com.guigu.buy.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.guigu.buy.pojo.OutDetails;
import com.guigu.buy.service.IOutDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author com.guigu
 * @since 2024-05-15
 */
@CrossOrigin
@Controller
@RequestMapping("/buy/outDetails")
public class OutDetailsController {
    @Autowired
    private IOutDetailsService outDetailsService;
    @RequestMapping("/getByParentId/{id}")
    @ResponseBody
    public List<OutDetails> getByParentId(@PathVariable int id){
        QueryWrapper wrapper=new QueryWrapper();
            wrapper.eq("parent_id",id);
        return outDetailsService.list(wrapper);
    }
}
